package com.cgbl.cg.adapter

import androidx.appcompat.widget.AppCompatImageView
import com.cgbl.cg.R
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.robot.base.model.CourseAllTypeBean

class SelectCourseAdapter(val select: String) :
    BaseQuickAdapter<CourseAllTypeBean, BaseViewHolder>(R.layout.app_item_select_course) {
    override fun convert(holder: BaseViewHolder, item: CourseAllTypeBean) {
        val ivSelect = holder.getView<AppCompatImageView>(R.id.item_iv_select)
        ivSelect.isSelected = item.name == select
        holder.setText(R.id.item_tv_name, item.name)
    }
}